<template>
  <div class="mobile personalMsg-mobile">
    <div class="mobileHeight">
      <a-card class="personalMsg-head clearfix mb10" :bordered="false">
        <img class="fl" :size="64" src="../../assets/img/mobile/logo.png" />
        <div class="msgHead-right fl">
          <p><span>{{realname}}</span><a-tag color="blue">学号：{{username}}</a-tag></p>
          <h3>{{departIds}}&nbsp; {{classes}}</h3>
        </div>
      </a-card>
      <a-card class="personalMsg-type mb10" :bordered="false">
        <a-row :gutter="16">
          <a-col class="gutter-row" :span="12">
            <div class="gutter-box gutter-list clearfix" @click="getMyRecord">
              <span class="fl"><i class="iconfont icondianzan"></i></span>
              <p class="fl">我的记录</p>
            </div>
          </a-col>
          <a-col class="gutter-row" :span="12">
            <div class="gutter-box gutter-help clearfix" @click="getMyProtecte">
              <span class="fl"><i class="iconfont iconhuida"></i></span>
              <p class="fl">我的求助</p>
            </div>
          </a-col>
        </a-row>
      </a-card>
      <a-card class="personalMsg-main" :bordered="false">
        <div class="protectAdd-list personalMsg-list clearfix" @click="aboutUs()">
          <span class="protectAdd-tips"><i class="iconfont iconguanzhu1"></i>关于我们</span>
        </div>
        <div class="protectAdd-list personalMsg-list clearfix" @click="agreedAnnouncement()">
          <span class="protectAdd-tips"><i class="iconfont icontiaokuanshengming"></i>协议及声明</span>
          <span class="protectAdd-msg fr"><i class="iconfont iconyou1"></i></span>
        </div>
      </a-card>
    </div>
    <div class="weui-tabbar">
      <a href="javascript:void(0);" class="weui-tabbar__item" @click="firstPage()">
        <span><i class="iconfont iconzhuye2"></i></span>
        <p class="weui-tabbar__label">首页</p>
      </a>
      <a href="javascript:void(0);" class="weui-tabbar__item" @click="hrhsPage()">
        <span><i class="iconfont icondianzan1"></i></span>
        <p class="weui-tabbar__label">好人好事</p>
      </a>
      <a href="javascript:void(0);" class="weui-tabbar__item" @click="myPage()">
        <span><i class="iconfont iconwodedangxuan"></i></span>
        <p class="weui-tabbar__label">我的</p>
      </a>
    </div>
  </div>
</template>
<script>
import Template1 from "@views/jeecg/JVxeDemo/layout-demo/Template1";
import { postAction,httpAction } from '@/api/manage'
export default {
  name: 'PersonalMsg',
  components: {Template1},
  data() {
    return {
      disabled: true,
      realname:"",
      username:"",
      departIds:"",
      classes:"",
    };
  },
  created(){
    document.title = "个人信息";
    this.getDetail();
  },
  methods: {
    getMyRecord(){
      this.$router.push('/MyRecordList');
    },
    getMyProtecte(){
      this.$router.push('/MyProtecteList');
    },
    getDetail(){
      let userId = localStorage.getItem("userId")
      postAction("/mobile/getUserById?userId="+userId).then(res=>{
        if(res.success){
          this.realname = res.result.realname;
          this.username = res.result.username;
          this.departIds = res.result.departIds;
          this.classes = res.result.classes;
        }
      }).catch(()=>{

      })
    },
    aboutUs(){
      this.$router.push('/AboutUs');
    },
    agreedAnnouncement(){
      this.$router.push('/AgreedAnnouncement');
    },
    firstPage(){
      this.$router.push('/MinorsProtecteGuide');
    },
    hrhsPage(){
      this.$router.push('/GoodThingsList');
    },
    myPage(){
      this.$router.push('/PersonalMsg');
    }
  }
};
</script>
